module.exports = function(req) {
    var cookie = {};
    var cookieStr = req.headers.cookie || '';
    cookieStr.split(';').forEach(function(item){
        if(!item) {
            return;
        }
        
        var arr = item.split('=');
        cookie[arr[0].trim()] = arr[1].trim();
    });
    return cookie;
}